package com.dz.mapper;

import com.dz.bean.Manager;
import com.dz.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ManagerDao {
    //添加
    int add(@Param("manager") Manager manager);

    //删除
    int delete(@Param("id") Integer id);

    //修改
    int edit(@Param("manager") Manager manager);

    //查询所有
    List<Manager> all(@Param("manager") Manager manager);

    //按id查询
    Manager findById(@Param("id") Integer id);

    //分页查询
    int pageCount(@Param("manager") Manager manager);

    //分页查询：查询数据
    List<Manager> page(@Param("page") Page page, @Param("manager")Manager manager);

    //根据username查询
    Manager getByUsername(@Param("username") String username);
}
